home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Utilities / Lightspeed C SKEL fldr / Skel updatewindow.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-06-17  |  1005 b   |  40 lines  |  [TEXT/KAHL]

  1. #include <WindowMgr.h>        
  2. #include <MenuMgr.h>
  3. #include <EventMgr.h>
  4. #include "Skel defines.h"
  5. #include "Skel globals.h"
  6.  
  7. #include <EventMgr.h>
  8.  
  9. /*
  10.  
  11. Update the contents of the given window
  12. ############################   UpdateWindow   ##########################
  13.  
  14.    This is our response to receipt of an update event for myWindow.
  15.    Since the window is likely to be inactive, the current GrafPort
  16.    will be elsewhere.  We must change it for drawing, yet leave it
  17.    as it was.
  18. */
  19.  
  20. updatewindow (awindow)
  21. WindowPtr awindow;
  22. {
  23.     GrafPtr saveport;        /* to save and restore the old port */
  24.  
  25.     BeginUpdate (awindow);    /* reset clipRgn etc to only redraw what's
  26.                    necessary. */
  27.  
  28.     GetPort (&saveport);    /* don't trash the port; we might be
  29.                    updating an inactive window */
  30.     SetPort (awindow);        /* work in the specified window */
  31.  
  32.     drawwindow ();        /* redraw contents of window */
  33.  
  34.     SetPort (saveport);        /* all nice and tidy as before */
  35.  
  36.     EndUpdate (awindow);
  37.  
  38. }                /* UpdateWindow */
  39.  
  40.